import { Effect, ImmerReducer, Reducer, Subscription } from 'umi';

export interface SearchData {
    order_type?: number,
    status?: number,
    pay_type?: number,
    _id?: string,
    user_id?: string,
    limit?: number,
    page?: number,
    dateLimit?: [
        string
    ]
}

//表格数据
export interface DataType {
    key: string;
    name: string;
    address: string;
    description: string;
}

//表格数据
export interface OrderType {
    _id: string;
    user: string;
    goods: string;
    pay_actual: string;
    pay_type: string,
    pay_time: string,
    status: string,
    action: string
}


export interface ProductModelState {
    order: [],
    updateOrder: [],
    updatedate: [],
    history: [],
    deleteDate: []
    casDate: [],
    saleDate: [],
    saleGood:{}
}

export interface ProductModelType {
    namespace?: string,
    state: ProductModelState,
    effects: {
        //query就是一个函数，函数的类型Effect
        query: Effect;
        updateGood: Effect;
        update: Effect;
        queryHistory: Effect;
        deleteManage: Effect;
        queryCas: Effect;
        querySale: Effect;
        saleGood:Effect;
        afterNode:Effect;

    },
    reducers: {
        initData: ImmerReducer<ProductModelState>;
        updateInitData: ImmerReducer<ProductModelState>;
        updateDate: ImmerReducer<ProductModelState>;
        historyDate: ImmerReducer<ProductModelState>;
        deleteManageDate: ImmerReducer<ProductModelState>;
        initCasData: ImmerReducer<ProductModelState>;
        initSaleData: ImmerReducer<ProductModelState>;
        saleGoodData:ImmerReducer<ProductModelState>;
        afterNodeData:ImmerReducer<ProductModelState>;

    },
    // subscriptions: { setup: Subscription };
}